﻿CREATE  proc [dbo].[danhmucHoaDon_Sua]
@so_hdon varchar(255),
@so_seri nvarchar(255),
@masothue nvarchar(255),
@so_hdon_old varchar(255)

as
if exists(select * from DM_HoaDon   Where so_hdon <>@so_hdon  and so_seri =@so_seri   )
begin
select ErrCode=0
end
else
begin
update DM_HoaDon    set so_seri=@so_seri,masothue=@masothue  

 WHere so_hdon=@so_hdon_old 
 
select ErrCode=1
end